function getDepth(arr) {
  let depth = 1;
  if(Array.isArray(arr)) {
    arr.forEach((item) => {
      if(Array.isArray(item)) {
        let newDepth = getDepth(item) + 1;
        if(newDepth > depth) {
          depth = newDepth;
        }
      }
    })
  }
  return depth;
}
let array = [[1,2,3],[3,4],[5,[7,8]]];
console.log(getDepth(array));